# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: team/kde <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-frameworks
pkgname=krunner
pkgver=6.1.0
pkgrel=0
pkgdesc="Framework for providing different actions given a string query"
# armhf blocked by extra-cmake-modules
arch="all !armhf"
url="https://community.kde.org/Frameworks"
license="LGPL-2.1-only AND LGPL-2.1-or-later"
depends_dev="
	kconfig-dev
	kcoreaddons-dev
	ki18n-dev
	kio-dev
	kitemmodels-dev
	kservice-dev
	qt6-qtbase-dev
	threadweaver-dev
	"
makedepends="$depends_dev
	doxygen
	extra-cmake-modules
	qt6-qttools-dev
	samurai
	"
checkdepends="
	dbus
	xvfb-run
	"
subpackages="$pkgname-dev $pkgname-doc"
_repo_url="https://invent.kde.org/frameworks/krunner.git"
source="https://download.kde.org/stable/frameworks/${pkgver%.*}/krunner-$pkgver.tar.xz"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_QCH=ON
	cmake --build build
}

check() {
	# dbusrunnertest, runnermanagertest and threadingtest are broken
	dbus-run-session -- xvfb-run ctest --test-dir build --output-on-failure -E "(dbusrunner|runnermanager|threading)test"
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
f9009333f860dd00fa5b67ab0f2bd6411828177ba6e8fd537eda6d21ee540dc0b6c3e15b543f260011e21c5f6092a84e2fe9349f3a0d6e88901abe18714e0fb5  krunner-6.1.0.tar.xz
"
